#ifndef OPENDB_H
#define OPENDB_H

#include <QObject>
#include <QSqlDatabase>
#include <QSqlQuery>

class OpenDB : public QObject
{
    Q_OBJECT
public:
    explicit OpenDB(QObject *parent = nullptr);
    static OpenDB& getInstance();
    void init();

    ~OpenDB();

    bool registHandle(const char* name, const char* pwd);
    bool loginHandle(const char* name, const char* pwd);
    void clientOffLine(const char* name);

signals:
public slots:
private:
    QSqlDatabase m_db;

};

#endif // OPENDB_H
